package BUCF;

import java.util.HashSet;
import java.util.Set;

import com.travel.core.AbstractDao;

public class userStep {
    private String user;

    public userStep() {
    }

    public userStep(String user) {
        this.user = user;
    }

    public Set<step> getUserStep() {
        Set<step> usersteps = new HashSet<step>();
        Set<spot_time> st = AbstractDao.getSpotTime(user);
        for (spot_time spt : st) {
            String spotName = spt.getSpotName();
            String time = spt.getTime().toString().split("\\s")[0];
            // System.out.println(spotName+" "+time);
            usersteps.add(new step(spotName, time));
        }
        return usersteps;
    }

    public static void main(String[] args) {
        Set<step> steps = new userStep("17608579").getUserStep();
        for (step s : steps) {
            System.out.println(s.getSpot() + " " + s.getTime());
        }
    }
}
